<?php
/**
 * Created by PhpStorm.
 * User: 764432054@qq.com
 * Date: 2020/5/13
 * Time: 23:29
 */
$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);

$res= socket_connect($socket,'39.100.78.46',8000);
if(!$res){
    echo socket_last_error($socket).PHP_EOL;
    die;

}
echo "connected ".PHP_EOL;
while($f=fgets(STDIN,10)){
    $send_length=socket_write($socket,$f,strlen($f));
    echo "send:".$f."-------len=".strlen($f).PHP_EOL;
//    sleep(1);
}





